/**
 * @(#)MobileClientDAOImpl.java 2017年6月7日
 * Copyright(C) 2017 ZHEXIN IT CO.,LTD. All rights reserved.
 */
package org.jsbd.boss.dao.impl;

import java.util.HashMap;
import java.util.List;

import org.jsbd.boss.dao.IMobileClientDAO;
import org.jsbd.boss.domian.channel.AndriodVerClient;
import org.jsbd.boss.domian.channel.MobileClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import edu.hziee.common.queue.IBatchExecutor;

/**
 * TODO 请加入本类的说明
 * 
 * @author <a href="mailto:xupengcheng@zhexinit.com" >徐鹏程</a>
 * @version 1.0.0
 */
@Service("mobileClientDao")
public class MobileClientDAOImpl extends CrackBaseDao implements IMobileClientDAO, IBatchExecutor<MobileClient> {
	public static final Logger LOGGER = LoggerFactory.getLogger(MobileClientDAOImpl.class);

	@Override
	public void batchInsertMobileClient(List<MobileClient> records) {
		super.batchInsert("qy_mobile_client.INSERT_MOBILE_CLIENT", records);
	}

	@Override
	public MobileClient selectMobileClient(String hstype, String hsman) {
		MobileClient mobileClient = new MobileClient();
		mobileClient.setHsman(hsman);
		mobileClient.setHstype(hstype);
		return (MobileClient) super.queryForObject("qy_mobile_client.SELECT_MOBILE_CLIENT", mobileClient);
	}

	@Override
	public MobileClient randomSelectMobileClient(String hsman) {
		HashMap map = new HashMap<>();
		map.put("hsman", hsman);
		return (MobileClient) super.queryForObject("qy_mobile_client.RANDOM_SELECT_MOBILE_CLIENT", map);
	}

	@Override
	public List<MobileClient> selectMobileType(String hsman) {
		MobileClient client = new MobileClient();
		client.setHsman(hsman);
		return super.queryForList("qy_mobile_client.SELECT_MOBILE_TYPE", client);
	}

	@Override
	public List<MobileClient> selectMobileType() {
		return super.queryForList("qy_mobile_client.SELECT_MOBILE_HSMAN");
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see edu.hziee.common.queue.IBatchExecutor#execute(java.util.List)
	 */
	@Override
	public void execute(List<MobileClient> records) {
		super.batchInsert("qy_mobile_client.INSERT_MOBILE_CLIENT", records);
	}

	/* (non-Javadoc)
	 * @see org.jsbd.boss.dao.IMobileClientDAO#selectAndriodVerClientList(java.lang.String)
	 */
	@Override
	public List<AndriodVerClient> selectAndriodVerClientList(String ver) {
		return super.queryForList("qy_mobile_client.SELECT_VER_LIST", ver);
	}
}
